import type { App } from 'vue';
import * as globalComponents from '@/components/Global';

export default {
  install(app: App) {
    for (let key in globalComponents) {
      if (!Object.prototype.hasOwnProperty.call(globalComponents, key)) continue;
      const comp = globalComponents[key as keyof typeof globalComponents];

      app.component(comp.name ?? key, globalComponents[key as keyof typeof globalComponents]);
    }
  }
};
